--
-- The snooper Keyword Lexer
--
%options template=KeywordTemplateF.gi

%Include
    KWLexerFoldedCaseMapF.gi 
%End

%Export
    -- List all the keywords the kwlexer will export to the lexer and parser 
    clear
    end 
    if
    else
    endif
    call
    return 
    exit 
    next 
    goto 
    do 
    loop 
    for 
    to 
    step

    hfor
    hnext

    load_script
    loadprofile
    run_script

    timer_begin
    timer_end
    sleep
    pause
    set 
    message
     
    __file__
    __line__
    auto_response
    on
    off

    reset
    reset2
     
    clear_fifo
    write_fifo

    upload 
    upload2
    
    beep
    cold

    eject
    insert 

    install 
    install_2

    jcop22_ext_auth
    jcop22_ext_auth_kmc
    jcop22_ext_auth_2
    jcop22_ext_auth_kmc_2
    jcop22_ext_auth_nonblock

    select 
    select_2
    
    delete
    delete_2

    
    apdu2
    prompt
    showapdu
    sw 
    des_3des_mac
    full_3des_mac
    mac_auto_mac
    mac_auto_mac_2
    superlong
    compare
    socket_message
    generate
    sendtext
    split
    push
    let 


%End

%Terminals
    a    b    c    d    e    f    g    h    i    j    k    l    m
    n    o    p    q    r    s    t    u    v    w    x    y    z

%End

%Start
    -- The Goal for the parser is a single Keyword
    Keyword
%End

%Rules

    Keyword ::=  e n d     
        /. %BeginAction
            %setResult(%_end);
           %EndAction
        ./  
  
        | i f         
        /. %BeginAction
            %setResult(%_if);
           %EndAction
        ./  
        | e l s e        
        /. %BeginAction 
            %setResult(%_else);
            %EndAction
        ./
        | e n d i f          
            /.%BeginAction
            %setResult(%_endif);
            %EndAction
        ./    
        | c a l l           
        /.%BeginAction
            %setResult(%_call);
        %EndAction
        ./        
        | r e t u r n   
            /.%BeginAction
            %setResult(%_return);
            %EndAction
        ./
        | e x i t     
        /.%BeginAction
            %setResult(%_exit);
            %EndAction 
        ./
        | n e x t     
            /.%BeginAction
            %setResult(%_next);
            %EndAction 
        ./
        | g o t o       
        /.%BeginAction
            %setResult(%_goto);
        %EndAction
        ./       
        | d o       
        /.%BeginAction
            %setResult(%_do);
        %EndAction
        ./        
        | l o o p       
        /.%BeginAction
            %setResult(%_loop);
        %EndAction
        ./      
        | f o r       
        /.%BeginAction
            %setResult(%_for);
        %EndAction./ 
        | t o       
        /.%BeginAction
            %setResult(%_to);
        %EndAction
        ./ 
        | s t e p        
        /.%BeginAction
            %setResult(%_step);
        %EndAction
        ./ 
        | h f o r        
        /.%BeginAction
            %setResult(%_hfor);
        %EndAction
        ./ 
        | h n e x t        
        /.%BeginAction
            %setResult(%_hnext);
        %EndAction
        ./   
        |  l o a d _ s c r i p t   
        /.%BeginAction
            %setResult(%_load_script);
        %EndAction
        ./  
        |  l o a d  p r o f i l e   
        /.%BeginAction
            %setResult(%_loadprofile);
        %EndAction
        ./  
        |  r u n _ s c r i p t   
        /.%BeginAction
            %setResult(%_run_script);
        %EndAction
        ./    

        |  t i m e r _ b e g i n  
        /.%BeginAction
            %setResult(%_timer_begin);
        %EndAction./   

        |  t i m e r _ e n d 
        /.%BeginAction
            %setResult(%_timer_end);
        %EndAction./   
    
        |  s l e e p
        /.%BeginAction
            %setResult(%_sleep);
        %EndAction./   

        |  p a u s e
        /.%BeginAction
            %setResult(%_pause);
        %EndAction./  

        | s e t        
        /. %BeginAction
            %setResult(%_set);
           %EndAction
        ./  
        | m e s s a g e          
        /. %BeginAction
            %setResult(%_message);
           %EndAction
        ./     

        | _ _ f i l e _ _       
        /.%BeginAction
            %setResult(%___file__);
        %EndAction
        ./ 

        | _ _ l i n e  _ _       
        /.%BeginAction
            %setResult(%___line__);
        %EndAction./    

        | a u t o _ r e s p o n s e      
        /.%BeginAction
            %setResult(%_auto_response);
        %EndAction./   

        | o n     
        /.%BeginAction
            %setResult(%_on);
        %EndAction./   

        | o f f    
        /.%BeginAction
            %setResult(%_off);
        %EndAction./  
        | r e s e t  
        /.%BeginAction
            %setResult(%_reset);
        %EndAction./  

        | r e s e t 2 
        /.%BeginAction
            %setResult(%_reset2);
        %EndAction./  

        | c l e a r _ f i f o 
        /.%BeginAction
            %setResult(%_clear_fifo);
        %EndAction./ 

        | w r i t e _ f i f o
        /.%BeginAction
            %setResult(%_write_fifo);
        %EndAction./  
        | u p l o a d
        /.%BeginAction
            %setResult(%_upload);
        %EndAction./  
        | u p l o a d 2
        /.%BeginAction
            %setResult(%_upload2);
        %EndAction./  
        | b e e p 
        /.%BeginAction
            %setResult(%_beep);
        %EndAction./  

        | c o l d 
        /.%BeginAction
            %setResult(%_cold);
        %EndAction./  

        | e j e c t
        /.%BeginAction
            %setResult(%_eject);
        %EndAction./ 

        | i n s e r t
        /.%BeginAction
            %setResult(%_insert);
        %EndAction./  



        | i n s t a l l
        /.%BeginAction
            %setResult(%_install);
        %EndAction./  

        | i n s t a l l _ 2
        /.%BeginAction
            %setResult(%_install_2);
        %EndAction./  

        | j c o p 2 2 _ e x t _ a u t h
        /.%BeginAction
            %setResult(%_jcop22_ext_auth);
        %EndAction./  

        | j c o p 2 2 _ e x t _ a u t h _ 2
        /.%BeginAction
            %setResult(%_jcop22_ext_auth_2);
        %EndAction./  

        | j c o p 2 2 _ e x t _ a u t h _ k m c
        /.%BeginAction
            %setResult(%_jcop22_ext_auth_kmc);
        %EndAction./ 

        | j c o p 2 2 _ e x t _ a u t h _ k m c _ 2
        /.%BeginAction
            %setResult(%_jcop22_ext_auth_kmc_2);
        %EndAction./ 

        | s e l e c t
        /.%BeginAction
            %setResult(%_select);
        %EndAction./ 
        | s e l e c t _ 2
        /.%BeginAction
            %setResult(%_select_2);
        %EndAction./         

        | d e l e t e
        /.%BeginAction
            %setResult(%_delete);
        %EndAction./         
        | d e l e t e _ 2
        /.%BeginAction
            %setResult(%_delete_2);
        %EndAction./         
    

        | a p d u 2
        /.%BeginAction
            %setResult(%_apdu2);
        %EndAction./   

        | p r o m p t
        /.%BeginAction
            %setResult(%_prompt);
        %EndAction./   

        | s h o w a p d u
        /.%BeginAction
            %setResult(%_showapdu);
        %EndAction./   

        | s w
        /.%BeginAction
            %setResult(%_sw);
        %EndAction./   

        | d e s _ 3 d e s _ m a c
        /.%BeginAction
            %setResult(%_des_3des_mac);
        %EndAction./   

        | f u l l _ 3 d e s _ m a c
        /.%BeginAction
            %setResult(%_full_3des_mac);
        %EndAction./   
        | m a c _ a u t o _ m a c
        /.%BeginAction
            %setResult(%_mac_auto_mac);
        %EndAction./   

        | m a c _ a u t o _ m a c _ 2
        /.%BeginAction
            %setResult(%_mac_auto_mac_2);
        %EndAction./   

        | s u p e r l o n g
        /.%BeginAction
            %setResult(%_superlong);
        %EndAction./   

        | c o m p a r e
        /.%BeginAction
            %setResult(%_compare);
        %EndAction./   

        | s o c k e t _ m e s s a g e
        /.%BeginAction
            %setResult(%_socket_message);
        %EndAction./   

        | g e n e r a t e
        /.%BeginAction
            %setResult(%_generate);
        %EndAction./   

        | s e n d t e x t
        /.%BeginAction
            %setResult(%_sendtext);
        %EndAction./  

        | s p l i t
        /.%BeginAction
            %setResult(%_split);
        %EndAction./   

        | p u s h
        /.%BeginAction
            %setResult(%_push);
        %EndAction./  
        
        | l e t 
        /.%BeginAction
            %setResult(%_let);
        %EndAction./  
        

        | j c o p 2 2 _ e x t _ a u t h _ n o n b l o c k
        /.%BeginAction
            %setResult(%_jcop22_ext_auth_nonblock);
        %EndAction./  

        | c l e a r
        /.%BeginAction
            %setResult(%_clear);
        %EndAction./  
        
        
%End


